package com.ruoyi.productspecifications.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.productspecifications.mapper.ProductspecificationsMapper;
import com.ruoyi.productspecifications.domain.Productspecifications;
import com.ruoyi.productspecifications.service.IProductspecificationsService;

/**
 * 商品规格Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-06-30
 */
@Service
public class ProductspecificationsServiceImpl implements IProductspecificationsService 
{
    @Autowired
    private ProductspecificationsMapper productspecificationsMapper;

    /**
     * 查询商品规格
     * 
     * @param specId 商品规格主键
     * @return 商品规格
     */
    @Override
    public Productspecifications selectProductspecificationsBySpecId(Long specId)
    {
        return productspecificationsMapper.selectProductspecificationsBySpecId(specId);
    }

    /**
     * 查询商品规格列表
     * 
     * @param productspecifications 商品规格
     * @return 商品规格
     */
    @Override
    public List<Productspecifications> selectProductspecificationsList(Productspecifications productspecifications)
    {
        return productspecificationsMapper.selectProductspecificationsList(productspecifications);
    }

    /**
     * 新增商品规格
     * 
     * @param productspecifications 商品规格
     * @return 结果
     */
    @Override
    public int insertProductspecifications(Productspecifications productspecifications)
    {
        return productspecificationsMapper.insertProductspecifications(productspecifications);
    }

    /**
     * 修改商品规格
     * 
     * @param productspecifications 商品规格
     * @return 结果
     */
    @Override
    public int updateProductspecifications(Productspecifications productspecifications)
    {
        return productspecificationsMapper.updateProductspecifications(productspecifications);
    }

    /**
     * 批量删除商品规格
     * 
     * @param specIds 需要删除的商品规格主键
     * @return 结果
     */
    @Override
    public int deleteProductspecificationsBySpecIds(Long[] specIds)
    {
        return productspecificationsMapper.deleteProductspecificationsBySpecIds(specIds);
    }

    /**
     * 删除商品规格信息
     * 
     * @param specId 商品规格主键
     * @return 结果
     */
    @Override
    public int deleteProductspecificationsBySpecId(Long specId)
    {
        return productspecificationsMapper.deleteProductspecificationsBySpecId(specId);
    }
    /**
     * 删除商品规格信息
     *
     * @param ProductId 商品规格主键
     * @return 结果
     */
    @Override
    public List<Productspecifications> selectProductspecificationsByProductId(Long ProductId) {
        return productspecificationsMapper.selectProductspecificationsByProductId(ProductId);
    }
}
